<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="java.util.List"%>
    <%
       List li = (List)request.getAttribute("serviceTypeList");
      
    %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<%@page import="com.doone.telmarket.domain.ibator.ServiceTypeExample"%>
<%@page import="com.doone.telmarket.domain.ibator.ServiceType"%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>main</title>
<link rel="stylesheet" rev="stylesheet" href="${pageContext.request.contextPath}/css/admin/style-admin.css" type="text/css" media="all" />
<script src="${pageContext.request.contextPath}/js/jquery.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.ui.draggable.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/js/jquery.alerts.js" type="text/javascript"></script>
<link href="${pageContext.request.contextPath}/css/jquery.alerts.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript">

		function insertText(id,name){
				$("#serviceTypeId").val(id) ;
				$("#serviceTypeName").val(name);
				$("#fieldset").css("display","");
			}


		$(document).ready(function(){
			$("#form1").submit(function(){
					if($("#serviceTypeName").val()==""){
							jAlert('请选择服务类别','消息');
							return false;
						}
				});
			});
</script>
</head>
<body>
   <table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  <tr> 
      <th class="tablestyle_title" >增值业务服务类别管理</th>
  </tr>
  <tr>
    <td class="CPanel">
		<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
		<tr><td align="left">
			&nbsp;&nbsp;&nbsp;<a href="serviceType.jsp">新增服务类别</a>
			<a href="toDeleteServiceType">编辑服务类别</a>
		</td></tr>

		
		
		<tr align="center">
          <td class="TablePanel"></td>
		  </tr>
		  　<tr>
			<TD width="100%">
				<fieldset style="height:100%;">
				<legend>已有服务类别</legend>
					  <table border="0" border="1" cellpadding="0" cellspacing="0" style="width:100%;border: 1px solid;">
					  
					    <tr>
					    <td  align="left" >服务类别名称</td>
					    
					    </tr>
					    <tr>
					    	<td></td>
					    </tr>
					    <%
					      if(li!=null){
					    	  
					      
					    	for(int i=0;i<li.size();i++){
					    		ServiceType s = (ServiceType)li.get(i);
					    		%>
					    <tr>
						    <td>
						    	<div style="cursor:hand ;float:left;width: 300px"><%=s.getServiceTypeName() %></div>
						    	<div style="cursor:hand ;float:left;width: 50px" onclick="insertText('<%=s.getServiceTypeId() %>','<%=s.getServiceTypeName() %>');">修改</div>
						    	<div style="cursor:hand ;float:left;width: 50px" ><a href="deleteServiceType?serviceTypeId=<%=s.getServiceTypeId() %>">删除</a></div>
						    </td>
					    </tr>
					    		<%
					    	}}
					    %>
					  </table>
					  
			 <br />
				</fieldset>		
				<fieldset style="height:100%;display: none;" id="fieldset">
				<legend>编辑服务类别</legend>
				<div>
					     <form action="updateServiceType" id="form1" method="post">
					     	<label>服务类别名称：</label>
					     	<input type="text"  id="serviceTypeName"  name="serviceTypeName"><input type="hidden" id="serviceTypeId" name="serviceTypeId">
					     	<input type="submit" value="保存"  class="button" />　
					     </form>
					  </div>
				</fieldset>	
				
			</TD>
		</TR>
		
		</TABLE>
	
	
	 </td>
  </tr>
		<TR>
			<TD colspan="2" align="center" height="50px"></TD>
		</TR>
		</TABLE>
</body>
</html>